<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
		<link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/goods.css"/>
		<link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/css/jquery.slideBox.css"/>
		<script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script>
		<script type="text/javascript" src="__TMPL__/public/assets/js/jquery.slideBox.min.js"></script>
		<script type="text/javascript" src="__TMPL__/public/assets/js/jquery.slideBox.js"></script>
        <script type="text/javascript" src="__TMPL__/public/assets/js/layer/layer.js"></script>
		<title>商品详情</title>
		<script type="text/javascript"></script>
</head>
<body>
		<header>
		<div class="content">
			 <a href="javascript:history.back(-1);"></a>
            <a></a>
            <a href="javascript:;"></a>
		</div>
		</header>
</body>
<div id="demo3" class="slideBox">
  <ul class="items">
		<foreach name="good['more']['photos']" item="vo">
			<li><a href="#" title=""><img src="{:cmf_get_image_preview_url($vo['url'])}"></a></li>
		</foreach>
  </ul>
</div>

<div class="goodsdes">
	<p>{$good.post_title}</p>
	<p><span>￥</span><span>{$good['post_price']}</span><span>+{$good['post_score']}积分</span></p>
	<p><span>温馨提示:</span></p>
	<p>积分可兑换商品，如积分不够，可以使用等值现金购买商品</p>
</div>
<div class="goodsdet">
	<p><span>—&ensp; </span> 详情 <span> &ensp;—</span></p>
</div>
<div class="img">
    {$good.post_content}
</div>
 <div class="total">
     <php>$car_url=cmf_url('shop/good/car');</php>
    <div class="car" onclick="location.href='{$car_url}'">
        <img src="__TMPL__/public/assets/img/shoppingcar.png"/>
        <p>购物车</p>
        <div class="nub"><span id="car_num">{$num}</span></div>
    </div>
    <div class="add">加入购物车</div>
 </div>
<script type="text/javascript">
	$('#demo3').slideBox({
		duration : 0.3,//滚动持续时间，单位：秒
		easing : 'linear',//swing,linear//滚动特效
		delay : 3,//滚动延迟时间，单位：秒
		hideClickBar : false,//不自动隐藏点选按键
		clickBarRadius : 10
	});
</script>
<script>
    $(function () {
        var good_id='{$good.id}';
        $('.add').click(function () {
            $.ajax({
                type : "post",
                url : "/shop/good/add_car.html",
                async : true,
                data : {
                    "good_id" : good_id
                },
                success : function(data) {
                    layer.msg(data.msg);
                    if(data.code==1){
                        $('#car_num').html(data.data.num)
                    }else{
                        location.href='/user/login/index.html'
                    }
                }
            });
        })
    })
</script>

</body>
</html>